home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Arsenal / OS2 Arsenal v1.0 (Disc 2)(Arsenal Computer).ISO / os2_inet / progcsd.exe / SELECT.H < prev    next >
Text File  |  1993-02-24  |  2KB  |  45 lines

  1. /********************************************************copyrite.xic***/
  2. /*                                                                     */
  3. /*   Licensed Materials - Property of IBM                              */
  4. /*                                                                     */
  5. /*   This product contains "Restricted Materials of IBM":              */
  6. /*      Program Number:   5798RXW                                      */
  7. /*      Program Name:     IBM TCP/IP Version 1.2 for OS/2              */
  8. /*   (C) Copyright IBM Corporation. 1990, 1991.                        */
  9. /*                                                                     */
  10. /*   All rights reserved.                                              */
  11. /*                                                                     */
  12. /*   US Government Users Restricted Rights -                           */
  13. /*   Use, duplication or disclosure restricted by GSA ADP Schedule     */
  14. /*   Contract with IBM Corp.                                           */
  15. /*                                                                     */
  16. /*   See IBM Copyright Instructions.                                   */
  17. /*                                                                     */
  18. /********************************************************copyrite.xic***/
  19.  
  20. #define NBBY    8               /* number of bits in a byte */
  21. #ifndef FD_SETSIZE
  22. #define FD_SETSIZE      2048
  23. #endif
  24.  
  25. typedef long    fd_mask;
  26. #define NFDBITS (sizeof(fd_mask) * NBBY)        /* bits per mask */
  27. #ifndef howmany
  28. #define howmany(x, y)   (((x)+((y)-1))/(y))
  29. #endif
  30.  
  31. typedef struct fd_set {
  32.         fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
  33. } fd_set;
  34.  
  35.  
  36. #define FD_SET(n, p)    ((p)->fds_bits[(n)/NFDBITS] |= (1L << ((n) % NFDBITS)))
  37. #define FD_CLR(n, p)    ((p)->fds_bits[(n)/NFDBITS] &= ~(1L << ((n) % NFDBITS)))
  38. #define FD_ISSET(n, p)  ((p)->fds_bits[(n)/NFDBITS] & (1L << ((n) % NFDBITS)))
  39. #define FD_ZERO(p)      bzero((char *)(p), sizeof(*(p)))
  40.  
  41. #ifdef BSD_SELECT
  42. #define select(a,b,c,d,e) bsdselect(a,b,c,d,e)
  43. short _Far16 _Cdecl bsdselect( short,fd_set * _Seg16,fd_set * _Seg16,fd_set * _Seg16,struct timeval * _Seg16);
  44. #endif
  45.